﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace MvcDemo.Models
{

    /// <summary>
    /// 分页基类
    /// </summary>
    public class PageBaseInput
    {
        /// <summary>
        /// 当前页标
        /// </summary>
        [Required, Range(1, int.MaxValue, ErrorMessage = "只能是大于1的整数")]
        public int PageIndex { get; set; } = 1;

        /// <summary>
        /// 每页大小
        /// </summary>
        [Required, Range(1, 100, ErrorMessage = "只能是1到100的整数")]
        public int PageSize { set; get; } = 10;
    }

    /// <summary>
    /// 分页获取数据基类
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class PageBaseOutput<T>
    {
        /// <summary>
        /// 总分页数
        /// </summary>
        public long TotalPages { get; set; } = 0;

        /// <summary>
        /// 数据
        /// </summary>
        public IList<T> List { get; set; }
    }
}